home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / OCE.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  54.1 KB  |  1,856 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        OCE.a
  3. ;
  4. ;    Contains:    Apple Open Collaboration Environment (AOCE) Interfaces.
  5. ;
  6. ;    Version:    Technology:    AOCE Toolbox 1.02
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__OCE__') = 'UNDEFINED' THEN
  21. __OCE__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  25.     include 'Aliases.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'AppleTalk.a'                                        ;
  30. ;            include 'OSUtils.a'                                    ;
  31. ;                include 'MixedMode.a'                                ;
  32. ;                include 'Memory.a'                                    ;
  33. ;        include 'Files.a'                                            ;
  34. ;            include 'Finder.a'                                        ;
  35.  
  36.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  37.     include 'AppleEvents.a'
  38.     ENDIF
  39. ;        include 'Errors.a'                                            ;
  40. ;        include 'Events.a'                                            ;
  41. ;            include 'Quickdraw.a'                                    ;
  42. ;                include 'QuickdrawText.a'                            ;
  43. ;        include 'EPPC.a'                                            ;
  44. ;            include 'PPCToolbox.a'                                    ;
  45. ;            include 'Processes.a'                                    ;
  46. ;        include 'Notification.a'                                    ;
  47.  
  48.     IF &TYPE('__SCRIPT__') = 'UNDEFINED' THEN
  49.     include 'Script.a'
  50.     ENDIF
  51. ;        include 'IntlResources.a'                                    ;
  52.  
  53.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  54.     include 'Types.a'
  55.     ENDIF
  56. ; All utility routines defined here are callable at interrupt level. 
  57. ; typedef unsigned short     OCERecordTypeIndex
  58. ; typedef unsigned short     OCEAttributeTypeIndex
  59. ; For anyone who absolutely needs a define of the body of the standard record or
  60. ;attribute type, use these below.  CAUTION!  All the types below are assumed to be
  61. ;in character set 'smRoman'.  If you try to compare these to some RString or
  62. ;AttributeType variable, you must take the character set code into account.  Future
  63. ;standard types may be defined using character sets other than 'smRoman'. 
  64. ; All these standard definitions begin with the Apple symbol (not shown here).
  65. ;
  66. ;NOTE:  To access these, you must call OCEGetIndRecordType or OCEGetIndAttributeType
  67. ;with the proper index.  These routines return pointers to the standard type.
  68. ;This was done so that code fragments (INITs, CDEVs, CSAMs, etc). which cannot
  69. ;use global data can also use these. 
  70. ; Indices for the standard definitions for certain record types (OCERecordTypeIndex): 
  71.  
  72. kUserRecTypeNum                    EQU        1                    ; "User" 
  73. kGroupRecTypeNum                EQU        2                    ; "Group" 
  74. kMnMRecTypeNum                    EQU        3                    ; "AppleMail™ M&M" 
  75. kMnMForwarderRecTypeNum            EQU        4                    ; "AppleMail™ Fwdr" 
  76. kNetworkSpecRecTypeNum            EQU        5                    ; "NetworkSpec" 
  77. kADAPServerRecTypeNum            EQU        6                    ; "ADAP Server" 
  78. kADAPDNodeRecTypeNum            EQU        7                    ; "ADAP DNode" 
  79. kADAPDNodeRepRecTypeNum            EQU        8                    ; "ADAP DNode Rep" 
  80. kServerSetupRecTypeNum            EQU        9                    ; "Server Setup" 
  81. kDirectoryRecTypeNum            EQU        10                    ; "Directory" 
  82. kDNodeRecTypeNum                EQU        11                    ; "DNode" 
  83. kSetupRecTypeNum                EQU        12                    ; "Setup" 
  84. kMSAMRecTypeNum                    EQU        13                    ; "MSAM" 
  85. kDSAMRecTypeNum                    EQU        14                    ; "DSAM" 
  86. kAttributeValueRecTypeNum        EQU        15                    ; "Attribute Value" 
  87. kBusinessCardRecTypeNum            EQU        16                    ; "Business Card" 
  88. kMailServiceRecTypeNum            EQU        17                    ; "Mail Service" 
  89. kCombinedRecTypeNum                EQU        18                    ; "Combined" 
  90. kOtherServiceRecTypeNum            EQU        19                    ; "Other Service" 
  91. kAFPServiceRecTypeNum            EQU        20                    ; "Other Service afps" 
  92. kFirstOCERecTypeNum                EQU        kUserRecTypeNum        ; first standard OCE record type 
  93. kLastOCERecTypeNum                EQU        kAFPServiceRecTypeNum ; last standard OCE record type 
  94. kNumOCERecTypes                    EQU        (kLastOCERecTypeNum - kFirstOCERecTypeNum + 1)
  95.  
  96. ; Indices for the standard definitions for certain attribute types (OCEAttributeTypeIndex): 
  97. kMemberAttrTypeNum                EQU        1001                ; "Member" 
  98. kAdminsAttrTypeNum                EQU        1002                ; "Administrators" 
  99. kMailSlotsAttrTypeNum            EQU        1003                ; "mailslots" 
  100. kPrefMailAttrTypeNum            EQU        1004                ; "pref mailslot" 
  101. kAddressAttrTypeNum                EQU        1005                ; "Address" 
  102. kPictureAttrTypeNum                EQU        1006                ; "Picture" 
  103. kAuthKeyAttrTypeNum                EQU        1007                ; "auth key" 
  104. kTelephoneAttrTypeNum            EQU        1008                ; "Telephone" 
  105. kNBPNameAttrTypeNum                EQU        1009                ; "NBP Name" 
  106. kQMappingAttrTypeNum            EQU        1010                ; "ForwarderQMap" 
  107. kDialupSlotAttrTypeNum            EQU        1011                ; "DialupSlotInfo" 
  108. kHomeNetAttrTypeNum                EQU        1012                ; "Home Internet" 
  109. kCoResAttrTypeNum                EQU        1013                ; "Co-resident M&M" 
  110. kFwdrLocalAttrTypeNum            EQU        1014                ; "FwdrLocalRecord" 
  111. kConnectAttrTypeNum                EQU        1015                ; "Connected To" 
  112. kForeignAttrTypeNum                EQU        1016                ; "Foreign RLIs" 
  113. kOwnersAttrTypeNum                EQU        1017                ; "Owners" 
  114. kReadListAttrTypeNum            EQU        1018                ; "ReadList" 
  115. kWriteListAttrTypeNum            EQU        1019                ; "WriteList" 
  116. kDescriptorAttrTypeNum            EQU        1020                ; "Descriptor" 
  117. kCertificateAttrTypeNum            EQU        1021                ; "Certificate" 
  118. kMsgQsAttrTypeNum                EQU        1022                ; "MessageQs" 
  119. kPrefMsgQAttrTypeNum            EQU        1023                ; "PrefMessageQ" 
  120. kMasterPFAttrTypeNum            EQU        1024                ; "MasterPF" 
  121. kMasterNetSpecAttrTypeNum        EQU        1025                ; "MasterNetSpec" 
  122. kServersOfAttrTypeNum            EQU        1026                ; "Servers Of" 
  123. kParentCIDAttrTypeNum            EQU        1027                ; "Parent CID" 
  124. kNetworkSpecAttrTypeNum            EQU        1028                ; "NetworkSpec" 
  125. kLocationAttrTypeNum            EQU        1029                ; "Location" 
  126. kTimeSvrTypeAttrTypeNum            EQU        1030                ; "TimeServer Type" 
  127. kUpdateTimerAttrTypeNum            EQU        1031                ; "Update Timer" 
  128. kShadowsOfAttrTypeNum            EQU        1032                ; "Shadows Of" 
  129. kShadowServerAttrTypeNum        EQU        1033                ; "Shadow Server" 
  130. kTBSetupAttrTypeNum                EQU        1034                ; "TB Setup" 
  131. kMailSetupAttrTypeNum            EQU        1035                ; "Mail Setup" 
  132. kSlotIDAttrTypeNum                EQU        1036                ; "SlotID" 
  133. kGatewayFileIDAttrTypeNum        EQU        1037                ; "Gateway FileID" 
  134. kMailServiceAttrTypeNum            EQU        1038                ; "Mail Service" 
  135. kStdSlotInfoAttrTypeNum            EQU        1039                ; "Std Slot Info" 
  136. kAssoDirectoryAttrTypeNum        EQU        1040                ; "Asso. Directory" 
  137. kDirectoryAttrTypeNum            EQU        1041                ; "Directory" 
  138. kDirectoriesAttrTypeNum            EQU        1042                ; "Directories" 
  139. kSFlagsAttrTypeNum                EQU        1043                ; "SFlags" 
  140. kLocalNameAttrTypeNum            EQU        1044                ; "Local Name" 
  141. kLocalKeyAttrTypeNum            EQU        1045                ; "Local Key" 
  142. kDirUserRIDAttrTypeNum            EQU        1046                ; "Dir User RID" 
  143. kDirUserKeyAttrTypeNum            EQU        1047                ; "Dir User Key" 
  144. kDirNativeNameAttrTypeNum        EQU        1048                ; "Dir Native Name" 
  145. kCommentAttrTypeNum                EQU        1049                ; "Comment" 
  146. kRealNameAttrTypeNum            EQU        1050                ; "Real Name" 
  147. kPrivateDataAttrTypeNum            EQU        1051                ; "Private Data" 
  148. kDirTypeAttrTypeNum                EQU        1052                ; "Directory Type" 
  149. kDSAMFileAliasAttrTypeNum        EQU        1053                ; "DSAM File Alias" 
  150. kCanAddressToAttrTypeNum        EQU        1054                ; "Can Address To" 
  151. kDiscriminatorAttrTypeNum        EQU        1055                ; "Discriminator" 
  152. kAliasAttrTypeNum                EQU        1056                ; "Alias" 
  153. kParentMSAMAttrTypeNum            EQU        1057                ; "Parent MSAM" 
  154. kParentDSAMAttrTypeNum            EQU        1058                ; "Parent DSAM" 
  155. kSlotAttrTypeNum                EQU        1059                ; "Slot" 
  156. kAssoMailServiceAttrTypeNum        EQU        1060                ; "Asso. Mail Service" 
  157. kFakeAttrTypeNum                EQU        1061                ; "Fake" 
  158. kInheritSysAdminAttrTypeNum        EQU        1062                ; "Inherit SysAdministrators" 
  159. kPreferredPDAttrTypeNum            EQU        1063                ; "Preferred PD" 
  160. kLastLoginAttrTypeNum            EQU        1064                ; "Last Login" 
  161. kMailerAOMStateAttrTypeNum        EQU        1065                ; "Mailer AOM State" 
  162. kMailerSendOptionsAttrTypeNum    EQU        1066                ; "Mailer Send Options" 
  163. kJoinedAttrTypeNum                EQU        1067                ; "Joined" 
  164. kUnconfiguredAttrTypeNum        EQU        1068                ; "Unconfigured" 
  165. kVersionAttrTypeNum                EQU        1069                ; "Version" 
  166. kLocationNamesAttrTypeNum        EQU        1070                ; "Location Names" 
  167. kActiveAttrTypeNum                EQU        1071                ; "Active" 
  168. kDeleteRequestedAttrTypeNum        EQU        1072                ; "Delete Requested" 
  169. kGatewayTypeAttrTypeNum            EQU        1073                ; "Gateway Type" 
  170. kFirstOCEAttrTypeNum            EQU        kMemberAttrTypeNum    ; first standard OCE attr type 
  171. kLastOCEAttrTypeNum                EQU        kGatewayTypeAttrTypeNum ; last standard OCE attr type 
  172. kNumOCEAttrTypes                EQU        (kLastOCEAttrTypeNum - kFirstOCEAttrTypeNum + 1)
  173.  
  174. ; Miscellaneous enums: 
  175. kRString32Size                    EQU        32                    ; max size of the body field in RString32 
  176. kRString64Size                    EQU        64                    ; max size of the body field in RString64 
  177. kNetworkSpecMaxBytes            EQU        32                    ; max size of the body field in NetworkSpec 
  178. kPathNameMaxBytes                EQU        1024                ; max size of the data field in PackedPathName 
  179. kDirectoryNameMaxBytes            EQU        32                    ; max size of the body field in DirectoryName 
  180. kAttributeTypeMaxBytes            EQU        32                    ; max size of the body field in AttributeType 
  181. kAttrValueMaxBytes                EQU        65536                ; max size of any attribute value 
  182. kRStringMaxBytes                EQU        256                    ; max size (in bytes) of the body field of a recordName or recordType 
  183. kRStringMaxChars                EQU        128                    ; max size (in chars) of the body field of a recordName or recordType 
  184.  
  185. kNULLDNodeNumber                EQU        0                    ; Special value meaning none specified 
  186. kRootDNodeNumber                EQU        2                    ; DNodeNum corresponding to the root of the tree 
  187.  
  188. ; This enum is used to select the kind of RString in calls such as OCERelRString,
  189. ;OCEEqualRString, and OCEValidRString.
  190. ;
  191. ;eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
  192. ;use RStrings for things other than what you see in this file.  If you want them to
  193. ;be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
  194. ;eGenericSensitive.  If you want them to be compared in a case- and diacritical-
  195. ;insensitive manner (c = C = ç), use eGenericInensitive.
  196. ;WARNING:  do not use eGenericSensitive and eGenericInsensitive with catalog
  197. ;names, entity names, pathname parts, entity types, network specs, or attribute
  198. ;types!  Don't assume that you know how they should be compared!!! 
  199. kOCEDirName                        EQU        0
  200. kOCERecordOrDNodeName            EQU        1
  201. kOCERecordType                    EQU        2
  202. kOCENetworkSpec                    EQU        3
  203. kOCEAttrType                    EQU        4
  204. kOCEGenericSensitive            EQU        5
  205. kOCEGenericInsensitive            EQU        6
  206.  
  207. ; typedef unsigned short     RStringKind
  208. ; Values for the signature field in Discriminator 
  209.  
  210. kDirAllKinds                    EQU        0
  211. kDirADAPKind                    EQU        'adap'
  212. kDirPersonalDirectoryKind        EQU        'pdir'
  213. kDirDSAMKind                    EQU        'dsam'
  214.  
  215. ; typedef unsigned long     OCEDirectoryKind
  216. ; Values returned by GetDSSpecInfo() 
  217.  
  218. kOCEInvalidDSSpec                EQU        $3F3F3F3F            ; could not be determined 
  219. kOCEDirsRootDSSpec                EQU        'root'                ; root of all catalogs ("Catalogs" icon) 
  220. kOCEDirectoryDSSpec                EQU        'dire'                ; catalog 
  221. kOCEDNodeDSSpec                    EQU        'dnod'                ; d-node 
  222. kOCERecordDSSpec                EQU        'reco'                ; record 
  223. kOCEentnDSSpec                    EQU        'entn'                ; extensionType is 'entn' 
  224. kOCENOTentnDSSpec                EQU        'not '
  225.  
  226. ; Values for AttributeTag 
  227. typeRString                        EQU        'rstr'
  228. typePackedDSSpec                EQU        'dspc'
  229. typeBinary                        EQU        'bnry'
  230.  
  231. ; Bit flag corresponding to the canContainRecords bit.  Use it like this:
  232. ;    if (foo & kCanContainRecords)
  233. ;        then this dNode can contain records!
  234. ;kForeignNode is used to indicate nodes in the name hierarchy that correspond to
  235. ;foreign catalogs (meaning ADAP sees no clusters or DNodes beneath it, but
  236. ;mail routers might be able to route to clusters beneath it. 
  237. kCanContainRecordsBit            EQU        0
  238. kForeignNodeBit                    EQU        1
  239.  
  240. ; DirNodeKind 
  241. kCanContainRecords                EQU        1 << kCanContainRecordsBit
  242. kForeignNode                    EQU        1 << kForeignNodeBit
  243.  
  244. ; typedef unsigned long     DirNodeKind
  245. ;*** Toolbox Control ***
  246. ; We will have a version number and attributes for toolboxes off the aa5e trap
  247. ;and the S&F server trap.
  248. ;
  249. ;This includes the OCE toolbox and S&F Server.  [Note: the S&F server will
  250. ;change to ONLY service ServerGateway calls —it will then be necessary to run
  251. ;it co–resident with an OCE toolbox].
  252. ;
  253. ;The high order word will represent the S&F Server version number.  The low
  254. ;order word will represent the OCE toolbox version number.  These will be zero
  255. ;until the component is up and running.  It is not possible to know these
  256. ;a–priori. Note: there will not be a seperate version numbers for each component
  257. ;in the OCE toolbox or S&F server.
  258. ;
  259. ;The above is consistent with the standard System 7.0 usage of Gestalt.
  260. ;
  261. ;The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
  262. ;machine.
  263. ;
  264. ;The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
  265. ;
  266. ;The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
  267. ;available through the S&F server. This are essentially the server gateway calls.
  268. ;
  269. ;Any (future) remaining OCE attributes may not be established correctly until
  270. ;the attribute gestaltOCETBAvailable is set.
  271. ;
  272. ;The gestalt selectors and values are listed below: 
  273.  
  274. gestaltOCEToolboxVersion        EQU        'ocet'                ; OCE Toolbox version 
  275. gestaltOCEToolboxAttr            EQU        'oceu'
  276.  
  277. ; version includes:
  278. ; *  dirtb
  279. ; *  authtb
  280. ; *  mailtb
  281. ; *  ipmtb
  282. ; *  personal catalog
  283. ; *  ADSPSecure
  284. ; * e.g. all interfaces dependent on the aa5e trap. 
  285. gestaltOCETB                    EQU        $0102                ; OCE Toolbox version 1.02 
  286. gestaltSFServer                    EQU        $0100                ; S&F Server version 1.0 
  287. gestaltOCETBPresent                EQU        $01                    ; OCE toolbox is present, not running 
  288. gestaltOCETBAvailable            EQU        $02                    ; OCE toolbox is running and available 
  289. gestaltOCESFServerAvailable        EQU        $04                    ; S&F Server is running and available 
  290. gestaltOCETBNativeGlueAvailable    EQU        $10                    ; Native PowerPC Glue routines are availible 
  291.  
  292. ;    Constants used for Transitions. 
  293. ATTransIPMStart                    EQU        'ipms'
  294. ATTransIPMShutdown                EQU        'ipmd'
  295. ATTransDirStart                    EQU        'dirs'
  296. ATTransDirShutdown                EQU        'dird'
  297. ATTransAuthStart                EQU        'auts'
  298. ATTransAuthShutdown                EQU        'autd'
  299. ATTransSFStart                    EQU        's&fs'
  300. ATTransSFShutdown                EQU        's&fd'
  301.  
  302. ; Some definitions for time-related parameters: 
  303. ; Interpreted as UTC seconds since 1/1/1904 
  304. ; typedef unsigned long     UTCTime
  305. ; seconds EAST of Greenwich 
  306. ; typedef long                 UTCOffset
  307. ; This is the same as the ScriptManager script. 
  308. ; typedef short             CharacterSet
  309. ;*** RString ***
  310. ; struct RString is a maximum-sized structure.  Allocate one of these and it will
  311. ;hold any valid RString. 
  312. RString                 RECORD    0
  313. charSet                     ds.w   1        ; offset: $0 (0)
  314. dataLength                 ds.w   1        ; offset: $2 (2)
  315. body                     ds.b   256        ; offset: $4 (4)        ; place for characters 
  316. sizeof                     EQU *            ; size:   $104 (260)
  317.                         ENDR
  318.  
  319. ; typedef struct RString     RString
  320. ; struct ProtoRString is a minimum-sized structure.  Use this for a variable-length RString. 
  321. ProtoRString             RECORD    0
  322. charSet                     ds.w   1        ; offset: $0 (0)
  323. dataLength                 ds.w   1        ; offset: $2 (2)
  324. sizeof                     EQU *            ; size:   $4 (4)
  325.                         ENDR
  326.  
  327. ; typedef struct ProtoRString  ProtoRString
  328. ; typedef RString             *RStringPtr, **RStringHandle
  329. ; typedef ProtoRString         *ProtoRStringPtr
  330. RString64                 RECORD    0
  331. charSet                     ds.w   1        ; offset: $0 (0)
  332. dataLength                 ds.w   1        ; offset: $2 (2)
  333. body                     ds.b   64        ; offset: $4 (4)
  334. sizeof                     EQU *            ; size:   $44 (68)
  335.                         ENDR
  336.  
  337. ; typedef struct RString64     RString64
  338. RString32                 RECORD    0
  339. charSet                     ds.w   1        ; offset: $0 (0)
  340. dataLength                 ds.w   1        ; offset: $2 (2)
  341. body                     ds.b   32        ; offset: $4 (4)
  342. sizeof                     EQU *            ; size:   $24 (36)
  343.                         ENDR
  344.  
  345. ; typedef struct RString32     RString32
  346. ; Standard definitions for the entity type field and attribute type
  347. ;have been moved to the end of the file. 
  348. ; Copies str1 to str2.  str2Length is the size of str2, excluding header.
  349. ;A memFull error will be returned if that is not as large as str1->dataLength. 
  350. ;
  351. ; pascal OSErr OCECopyRString(const RString *str1, RString *str2, unsigned short str2Length)
  352. ;
  353.     IF ¬ GENERATINGCFM THEN
  354.         Macro
  355.         _OCECopyRString
  356.             move.w    #776,d0
  357.             dc.w     $AA5C
  358.         EndM
  359.     ELSE
  360.         IMPORT_CFM_FUNCTION    OCECopyRString
  361.     ENDIF
  362.  
  363. ;    Make an RString from a C string.  If the c string is bigger than rStrLength,
  364. ;only rStrLength bytes will be copied. (rStrLength does not include the header size) 
  365. ;
  366. ; pascal void OCECToRString(const char *cStr, CharacterSet charSet, RString *rStr, unsigned short rStrLength)
  367. ;
  368.     IF ¬ GENERATINGCFM THEN
  369.         Macro
  370.         _OCECToRString
  371.             move.w    #825,d0
  372.             dc.w     $AA5C
  373.         EndM
  374.     ELSE
  375.         IMPORT_CFM_FUNCTION    OCECToRString
  376.     ENDIF
  377.  
  378. ;    Make an RString from a Pascal string.  If the Pascal string is bigger than rStrLength,
  379. ;only rStrLength bytes will be copied. (rStrLength does not include the header size) 
  380. ;
  381. ; pascal void OCEPToRString(ConstStr255Param pStr, CharacterSet charSet, RString *rStr, unsigned short rStrLength)
  382. ;
  383.     IF ¬ GENERATINGCFM THEN
  384.         Macro
  385.         _OCEPToRString
  386.             move.w    #826,d0
  387.             dc.w     $AA5C
  388.         EndM
  389.     ELSE
  390.         IMPORT_CFM_FUNCTION    OCEPToRString
  391.     ENDIF
  392.  
  393. ;    Make a Pascal string from an RString.  It's up to you to check the char set of
  394. ;the RString, or if the length of the RString is greater than 255 (the Pascal string's
  395. ;length will simply be the lower byte of the RString's length).  The StringPtr that is
  396. ;returned will point directly into the RString (no memory will be allocated). 
  397. ;
  398. ; pascal StringPtr OCERToPString(const RString *rStr)
  399. ;
  400.     IF ¬ GENERATINGCFM THEN
  401.         Macro
  402.         _OCERToPString
  403.             move.w    #827,d0
  404.             dc.w     $AA5C
  405.         EndM
  406.     ELSE
  407.         IMPORT_CFM_FUNCTION    OCERToPString
  408.     ENDIF
  409.  
  410. ;    Check the relative equality of two RStrings.  Determines if str1 is greater than,
  411. ;equal to, or less than str2.  Result types for OCERelRString are defined in <OSUtils.h>
  412. ;(same as for RelString). 
  413. ;
  414. ; pascal short OCERelRString(const void *str1, const void *str2, RStringKind kind)
  415. ;
  416.     IF ¬ GENERATINGCFM THEN
  417.         Macro
  418.         _OCERelRString
  419.             move.w    #813,d0
  420.             dc.w     $AA5C
  421.         EndM
  422.     ELSE
  423.         IMPORT_CFM_FUNCTION    OCERelRString
  424.     ENDIF
  425.  
  426. ;    Check for equality of two RStrings. Returns true if equal. 
  427. ;
  428. ; pascal Boolean OCEEqualRString(const void *str1, const void *str2, RStringKind kind)
  429. ;
  430.     IF ¬ GENERATINGCFM THEN
  431.         Macro
  432.         _OCEEqualRString
  433.             move.w    #790,d0
  434.             dc.w     $AA5C
  435.         EndM
  436.     ELSE
  437.         IMPORT_CFM_FUNCTION    OCEEqualRString
  438.     ENDIF
  439.  
  440. ;    Check the validity of an RString.  Returns true if the RString is valid 
  441. ;
  442. ; pascal Boolean OCEValidRString(const void *str, RStringKind kind)
  443. ;
  444.     IF ¬ GENERATINGCFM THEN
  445.         Macro
  446.         _OCEValidRString
  447.             move.w    #824,d0
  448.             dc.w     $AA5C
  449.         EndM
  450.     ELSE
  451.         IMPORT_CFM_FUNCTION    OCEValidRString
  452.     ENDIF
  453.  
  454. ;*** CreationID ***
  455. CreationID                 RECORD    0
  456. source                     ds.l   1        ; offset: $0 (0)        ; Fields definitions and usage are not defined 
  457. seq                         ds.l   1        ; offset: $4 (4)
  458. sizeof                     EQU *            ; size:   $8 (8)
  459.                         ENDR
  460.  
  461. ; typedef struct CreationID  CreationID
  462. ; typedef CreationID         AttributeCreationID
  463. ; Returns a pointer to a null CreationID . 
  464. ;
  465. ; pascal const CreationID *OCENullCID(void)
  466. ;
  467.     IF ¬ GENERATINGCFM THEN
  468.         Macro
  469.         _OCENullCID
  470.             move.w    #836,d0
  471.             dc.w     $AA5C
  472.         EndM
  473.     ELSE
  474.         IMPORT_CFM_FUNCTION    OCENullCID
  475.     ENDIF
  476.  
  477. ; Returns a pointer to a special CreationID used within the PathFinder. 
  478. ;
  479. ; pascal const CreationID *OCEPathFinderCID(void)
  480. ;
  481.     IF ¬ GENERATINGCFM THEN
  482.         Macro
  483.         _OCEPathFinderCID
  484.             move.w    #828,d0
  485.             dc.w     $AA5C
  486.         EndM
  487.     ELSE
  488.         IMPORT_CFM_FUNCTION    OCEPathFinderCID
  489.     ENDIF
  490.  
  491. ; Sets the CreationID to a null value. 
  492. ;
  493. ; pascal void OCESetCreationIDtoNull(CreationID *cid)
  494. ;
  495.     IF ¬ GENERATINGCFM THEN
  496.         Macro
  497.         _OCESetCreationIDtoNull
  498.             move.w    #814,d0
  499.             dc.w     $AA5C
  500.         EndM
  501.     ELSE
  502.         IMPORT_CFM_FUNCTION    OCESetCreationIDtoNull
  503.     ENDIF
  504.  
  505. ; Copies the value of cid1 to cid2. 
  506. ;
  507. ; pascal void OCECopyCreationID(const CreationID *cid1, CreationID *cid2)
  508. ;
  509.     IF ¬ GENERATINGCFM THEN
  510.         Macro
  511.         _OCECopyCreationID
  512.             move.w    #768,d0
  513.             dc.w     $AA5C
  514.         EndM
  515.     ELSE
  516.         IMPORT_CFM_FUNCTION    OCECopyCreationID
  517.     ENDIF
  518.  
  519. ; Check the equality of two CreationIDs. 
  520. ;
  521. ; pascal Boolean OCEEqualCreationID(const CreationID *cid1, const CreationID *cid2)
  522. ;
  523.     IF ¬ GENERATINGCFM THEN
  524.         Macro
  525.         _OCEEqualCreationID
  526.             move.w    #780,d0
  527.             dc.w     $AA5C
  528.         EndM
  529.     ELSE
  530.         IMPORT_CFM_FUNCTION    OCEEqualCreationID
  531.     ENDIF
  532.  
  533. ;*** NetworkSpec ***
  534. ; For the record, a NetworkSpec is an RString with a smaller maximum size.
  535. ;I don't just typedef it to an RString, because I want the definition of the NetworkSpec
  536. ;struct to contain the max length.  But it should be possible to typecast any
  537. ;NetworkSpec to an RString and use all the RString utilities on it. 
  538. NetworkSpec             RECORD    0
  539. charSet                     ds.w   1        ; offset: $0 (0)
  540. dataLength                 ds.w   1        ; offset: $2 (2)
  541. body                     ds.b   32        ; offset: $4 (4)        ; always fixed at the max size 
  542. sizeof                     EQU *            ; size:   $24 (36)
  543.                         ENDR
  544.  
  545. ; typedef struct NetworkSpec  NetworkSpec
  546. ; typedef NetworkSpec         *NetworkSpecPtr
  547. ;*** PackedPathName ***
  548. ; struct PackedPathName is a maximum-sized structure.  Allocate one of
  549. ;these and it will hold any valid packed pathname. 
  550. PackedPathName             RECORD    0
  551. dataLength                 ds.w   1        ; offset: $0 (0)
  552. data                     ds.b   1022    ; offset: $2 (2)
  553. sizeof                     EQU *            ; size:   $400 (1024)
  554.                         ENDR
  555.  
  556. ; typedef struct PackedPathName  PackedPathName
  557. ; struct ProtoPackedPathName is a minimum-sized structure.  Use this
  558. ;for a variable-length packed PathName. 
  559. ProtoPackedPathName     RECORD    0
  560. dataLength                 ds.w   1        ; offset: $0 (0)
  561. sizeof                     EQU *            ; size:   $2 (2)
  562.                         ENDR
  563.  
  564. ; typedef struct ProtoPackedPathName  ProtoPackedPathName
  565. ; typedef PackedPathName     *PackedPathNamePtr
  566. ; typedef ProtoPackedPathName  *ProtoPackedPathNamePtr
  567. ;
  568. ;Copy the contents of path1 to path2.  path2Length is the size of path2, and must
  569. ;be large enough to hold a copy of path1.  A memFull error will be returned if that
  570. ;is not the case.
  571. ;
  572. ;
  573. ; pascal OSErr OCECopyPackedPathName(const PackedPathName *path1, PackedPathName *path2, unsigned short path2Length)
  574. ;
  575.     IF ¬ GENERATINGCFM THEN
  576.         Macro
  577.         _OCECopyPackedPathName
  578.             move.w    #772,d0
  579.             dc.w     $AA5C
  580.         EndM
  581.     ELSE
  582.         IMPORT_CFM_FUNCTION    OCECopyPackedPathName
  583.     ENDIF
  584.  
  585. ;
  586. ;Returns true if packed path pointer is nil, or is of zero length, or is of
  587. ;length 2 and nParts of zero.
  588. ;
  589. ;
  590. ; pascal Boolean OCEIsNullPackedPathName(const PackedPathName *path)
  591. ;
  592.     IF ¬ GENERATINGCFM THEN
  593.         Macro
  594.         _OCEIsNullPackedPathName
  595.             move.w    #797,d0
  596.             dc.w     $AA5C
  597.         EndM
  598.     ELSE
  599.         IMPORT_CFM_FUNCTION    OCEIsNullPackedPathName
  600.     ENDIF
  601.  
  602. ;
  603. ;OCEUnpackPathName breaks apart the path into its component RStrings, writing string
  604. ;pointers into the array 'parts', which the client asserts can hold as many as
  605. ;'nParts' elements. The number of parts actually found is returned.  Strings are
  606. ;placed in the array in order from lowest to highest.  The first pathName element
  607. ;beneath the root appears last.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO
  608. ;THE PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  609. ;WITH THE UNPACKED STRUCT AS WELL
  610. ;
  611. ;
  612. ; pascal unsigned short OCEUnpackPathName(const PackedPathName *path, RStringPtr *parts, unsigned short nParts)
  613. ;
  614.     IF ¬ GENERATINGCFM THEN
  615.         Macro
  616.         _OCEUnpackPathName
  617.             move.w    #816,d0
  618.             dc.w     $AA5C
  619.         EndM
  620.     ELSE
  621.         IMPORT_CFM_FUNCTION    OCEUnpackPathName
  622.     ENDIF
  623.  
  624. ;
  625. ; pascal unsigned short OCEPackedPathNameSize(const RStringPtr *parts, unsigned short nParts)
  626. ;
  627.     IF ¬ GENERATINGCFM THEN
  628.         Macro
  629.         _OCEPackedPathNameSize
  630.             move.w    #808,d0
  631.             dc.w     $AA5C
  632.         EndM
  633.     ELSE
  634.         IMPORT_CFM_FUNCTION    OCEPackedPathNameSize
  635.     ENDIF
  636.  
  637. ; OCEDNodeNameCount returns the number of RStrings contained within the path. 
  638. ;
  639. ; pascal unsigned short OCEDNodeNameCount(const PackedPathName *path)
  640. ;
  641.     IF ¬ GENERATINGCFM THEN
  642.         Macro
  643.         _OCEDNodeNameCount
  644.             move.w    #812,d0
  645.             dc.w     $AA5C
  646.         EndM
  647.     ELSE
  648.         IMPORT_CFM_FUNCTION    OCEDNodeNameCount
  649.     ENDIF
  650.  
  651. ;
  652. ;OCEPackPathName packs the parts into the storage provided as 'path'.  path must be
  653. ;large enough to hold the packed pathname.  A memFull error will be returned if
  654. ;pathLength is too small.  parts[0] should contain the deepest pathName element,
  655. ;and parts[nParts - 1] should contain the name of the first pathName element beneath
  656. ;the root. 
  657. ;
  658. ;
  659. ; pascal OSErr OCEPackPathName(RStringPtr *parts, unsigned short nParts, PackedPathName *path, unsigned short pathLength)
  660. ;
  661.     IF ¬ GENERATINGCFM THEN
  662.         Macro
  663.         _OCEPackPathName
  664.             move.w    #803,d0
  665.             dc.w     $AA5C
  666.         EndM
  667.     ELSE
  668.         IMPORT_CFM_FUNCTION    OCEPackPathName
  669.     ENDIF
  670.  
  671. ;
  672. ;Check the equality of two packed paths.
  673. ;
  674. ;
  675. ; pascal Boolean OCEEqualPackedPathName(const PackedPathName *path1, const PackedPathName *path2)
  676. ;
  677.     IF ¬ GENERATINGCFM THEN
  678.         Macro
  679.         _OCEEqualPackedPathName
  680.             move.w    #785,d0
  681.             dc.w     $AA5C
  682.         EndM
  683.     ELSE
  684.         IMPORT_CFM_FUNCTION    OCEEqualPackedPathName
  685.     ENDIF
  686.  
  687. ;
  688. ;OCEValidPackedPathName checks that the packed PathName is internally consistent.
  689. ;Returns true if it's ok.
  690. ;
  691. ;
  692. ; pascal Boolean OCEValidPackedPathName(const PackedPathName *path)
  693. ;
  694.     IF ¬ GENERATINGCFM THEN
  695.         Macro
  696.         _OCEValidPackedPathName
  697.             move.w    #820,d0
  698.             dc.w     $AA5C
  699.         EndM
  700.     ELSE
  701.         IMPORT_CFM_FUNCTION    OCEValidPackedPathName
  702.     ENDIF
  703.  
  704. ;*** DirDiscriminator ***
  705. DirDiscriminator         RECORD    0
  706. signature                 ds.l   1        ; offset: $0 (0)
  707. misc                     ds.l   1        ; offset: $4 (4)
  708. sizeof                     EQU *            ; size:   $8 (8)
  709.                         ENDR
  710.  
  711. ; typedef struct DirDiscriminator  DirDiscriminator
  712. ; Copies the value of disc1 to disc2. 
  713. ;
  714. ; pascal void OCECopyDirDiscriminator(const DirDiscriminator *disc1, DirDiscriminator *disc2)
  715. ;
  716.     IF ¬ GENERATINGCFM THEN
  717.         Macro
  718.         _OCECopyDirDiscriminator
  719.             move.w    #769,d0
  720.             dc.w     $AA5C
  721.         EndM
  722.     ELSE
  723.         IMPORT_CFM_FUNCTION    OCECopyDirDiscriminator
  724.     ENDIF
  725.  
  726. ; Check the equality of two DirDiscriminators. 
  727. ;
  728. ; pascal Boolean OCEEqualDirDiscriminator(const DirDiscriminator *disc1, const DirDiscriminator *disc2)
  729. ;
  730.     IF ¬ GENERATINGCFM THEN
  731.         Macro
  732.         _OCEEqualDirDiscriminator
  733.             move.w    #781,d0
  734.             dc.w     $AA5C
  735.         EndM
  736.     ELSE
  737.         IMPORT_CFM_FUNCTION    OCEEqualDirDiscriminator
  738.     ENDIF
  739.  
  740. ;
  741. ;This structure is called RLI because it really contains all the info you
  742. ;need to locate a record within the entire name space.  It contains four fields.
  743. ;The first two are the name of the catalog and a catalog discriminator.  These
  744. ;two fields are used to indicate to which catalog a given record belongs.  The
  745. ;discriminator is used to distinguish between two different catalogs that have
  746. ;the same name.
  747. ;
  748. ;The other two fields in the RLI structure are used to indicate a particular
  749. ;catalog node within the catalog specified by the directoryName and
  750. ;discriminator fields.  These fields are exactly analagous to the dirID and
  751. ;pathname used in HFS.  It is possible to specify a dNode just by dNodeNumber
  752. ;(pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
  753. ;or by a combination of the two.  The latter is called a 'partial pathname', and
  754. ;while it is valid in the Catalog Manager API, it is not supported by ADAP
  755. ;catalogs in Release 1.
  756. ;
  757. ;Note that the path parameter does not include the catalog name, but holds
  758. ;the names of all the nodes on the path to the desired catalog node, starting
  759. ;with the catalog node and working its way up the tree.
  760. ;
  761. ;*** RLI ***
  762. DirectoryName             RECORD    0
  763. charSet                     ds.w   1        ; offset: $0 (0)
  764. dataLength                 ds.w   1        ; offset: $2 (2)
  765. body                     ds.b   32        ; offset: $4 (4)        ; space for catalog name 
  766. sizeof                     EQU *            ; size:   $24 (36)
  767.                         ENDR
  768.  
  769. ; typedef struct DirectoryName  DirectoryName
  770. ; typedef DirectoryName     *DirectoryNamePtr
  771. ; Catalog node number 
  772. ; typedef unsigned long     DNodeNum
  773. RLI                     RECORD    0
  774. directoryName             ds.l   1        ; offset: $0 (0)        ; pointer to the name of the catalog root 
  775. discriminator             ds.l   2        ; offset: $4 (4)        ; used to discriminate between dup catalog names 
  776. dNodeNumber                 ds.l   1        ; offset: $C (12)        ; number of the node 
  777. path                     ds.l   1        ; offset: $10 (16)        ; old-style RLI 
  778. sizeof                     EQU *            ; size:   $14 (20)
  779.                         ENDR
  780.  
  781. ; typedef struct RLI         RLI
  782. ; typedef RLI                 *RLIPtr
  783. ;
  784. ;Create a new RLI from the catalog name, discriminator, DNode number, and
  785. ;PackedPathName.  You must allocate the storage for the RLI and pass in a pointer
  786. ;to it.
  787. ;
  788. ;
  789. ; pascal void OCENewRLI(RLI *newRLI, const DirectoryName *dirName, DirDiscriminator *discriminator, DNodeNum dNodeNumber, const PackedPathName *path)
  790. ;
  791.     IF ¬ GENERATINGCFM THEN
  792.         Macro
  793.         _OCENewRLI
  794.             move.w    #799,d0
  795.             dc.w     $AA5C
  796.         EndM
  797.     ELSE
  798.         IMPORT_CFM_FUNCTION    OCENewRLI
  799.     ENDIF
  800.  
  801. ;
  802. ;Duplicate the contents of rli1 to rli2.  No errors are returned. This
  803. ;simply copies the pointers to the catalog name and path, wiping out any pointer
  804. ;that you might have had in there.
  805. ;
  806. ;
  807. ; pascal void OCEDuplicateRLI(const RLI *rli1, RLI *rli2)
  808. ;
  809.     IF ¬ GENERATINGCFM THEN
  810.         Macro
  811.         _OCEDuplicateRLI
  812.             move.w    #779,d0
  813.             dc.w     $AA5C
  814.         EndM
  815.     ELSE
  816.         IMPORT_CFM_FUNCTION    OCEDuplicateRLI
  817.     ENDIF
  818.  
  819. ;
  820. ;Copy the contents of rli1 to rli2.  rli2 must already contain
  821. ;pointers to structures large enough to hold copies of the corresponding
  822. ;fields from rli1.  A memFull error will be returned if that is not the case.
  823. ;So if you allocate a brand new empty destination, you must at least set up
  824. ;its length fields.
  825. ;
  826. ;
  827. ; pascal OSErr OCECopyRLI(const RLI *rli1, RLI *rli2)
  828. ;
  829.     IF ¬ GENERATINGCFM THEN
  830.         Macro
  831.         _OCECopyRLI
  832.             move.w    #775,d0
  833.             dc.w     $AA5C
  834.         EndM
  835.     ELSE
  836.         IMPORT_CFM_FUNCTION    OCECopyRLI
  837.     ENDIF
  838.  
  839. ;
  840. ;Check the equality of two RLIs.  This will take into account differences
  841. ;in the case and diacriticals of the directoryName and the PathName.
  842. ;NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
  843. ;AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME.  IN OTHER WORDS,
  844. ;THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
  845. ;The one exception is that if the pathname is nil, a dNodeNumber of zero and
  846. ;kRootDNodeNumber will be treated as equal.
  847. ;
  848. ;
  849. ; pascal Boolean OCEEqualRLI(const RLI *rli1, const RLI *rli2)
  850. ;
  851.     IF ¬ GENERATINGCFM THEN
  852.         Macro
  853.         _OCEEqualRLI
  854.             move.w    #789,d0
  855.             dc.w     $AA5C
  856.         EndM
  857.     ELSE
  858.         IMPORT_CFM_FUNCTION    OCEEqualRLI
  859.     ENDIF
  860.  
  861. ;
  862. ;Check the validity of an RLI.  This checks that the catalog name length
  863. ;is within bounds, and the packed pathname (if specified) is valid.
  864. ;
  865. ;
  866. ; pascal Boolean OCEValidRLI(const RLI *theRLI)
  867. ;
  868.     IF ¬ GENERATINGCFM THEN
  869.         Macro
  870.         _OCEValidRLI
  871.             move.w    #823,d0
  872.             dc.w     $AA5C
  873.         EndM
  874.     ELSE
  875.         IMPORT_CFM_FUNCTION    OCEValidRLI
  876.     ENDIF
  877.  
  878. ;*** PackedRLI ***
  879. ;
  880. ;struct PackedRLI is a maximum-sized structure.  Allocate one of
  881. ;these and it will hold any valid packed pathname.
  882. ;
  883.  
  884. kRLIMaxBytes                    EQU        1296
  885.  
  886. PackedRLI                 RECORD    0
  887. dataLength                 ds.w   1        ; offset: $0 (0)
  888. data                     ds.b   1296    ; offset: $2 (2)
  889. sizeof                     EQU *            ; size:   $512 (1298)
  890.                         ENDR
  891.  
  892. ; typedef struct PackedRLI     PackedRLI
  893. ;
  894. ;struct ProtoPackedRLI is a minimum-sized structure.  Use this
  895. ;for a variable-length packed RLI.
  896. ;
  897. ProtoPackedRLI             RECORD    0
  898. dataLength                 ds.w   1        ; offset: $0 (0)
  899. sizeof                     EQU *            ; size:   $2 (2)
  900.                         ENDR
  901.  
  902. ; typedef struct ProtoPackedRLI  ProtoPackedRLI
  903. ; typedef PackedRLI         *PackedRLIPtr
  904. ; typedef ProtoPackedRLI     *ProtoPackedRLIPtr
  905. ;
  906. ;Copy the contents of prli1 to prli2.  prli2Length is the size of prli2, and must
  907. ;be large enough to hold a copy of prli1.  A memFull error will be returned if that
  908. ;is not the case.
  909. ;
  910. ;
  911. ; pascal OSErr OCECopyPackedRLI(const PackedRLI *prli1, PackedRLI *prli2, unsigned short prli2Length)
  912. ;
  913.     IF ¬ GENERATINGCFM THEN
  914.         Macro
  915.         _OCECopyPackedRLI
  916.             move.w    #773,d0
  917.             dc.w     $AA5C
  918.         EndM
  919.     ELSE
  920.         IMPORT_CFM_FUNCTION    OCECopyPackedRLI
  921.     ENDIF
  922.  
  923. ;
  924. ;OCEUnpackRLI breaks apart the prli into its components, writing pointers into
  925. ;the rli structure.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE
  926. ;PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  927. ;WITH THE UNPACKED STRUCT AS WELL
  928. ;
  929. ;
  930. ; pascal void OCEUnpackRLI(const PackedRLI *prli, RLI *theRLI)
  931. ;
  932.     IF ¬ GENERATINGCFM THEN
  933.         Macro
  934.         _OCEUnpackRLI
  935.             move.w    #817,d0
  936.             dc.w     $AA5C
  937.         EndM
  938.     ELSE
  939.         IMPORT_CFM_FUNCTION    OCEUnpackRLI
  940.     ENDIF
  941.  
  942. ;
  943. ;OCEPackedRLISize computes the number of bytes of memory needed to hold a
  944. ;PackedRLI manufactured from an RLI.  This length
  945. ;includes the length of the length field of PackedRLI, so it
  946. ;is safe to do a NewPtr (OCEPackedRLISize(...)).
  947. ;
  948. ;
  949. ; pascal unsigned short OCEPackedRLISize(const RLI *theRLI)
  950. ;
  951.     IF ¬ GENERATINGCFM THEN
  952.         Macro
  953.         _OCEPackedRLISize
  954.             move.w    #810,d0
  955.             dc.w     $AA5C
  956.         EndM
  957.     ELSE
  958.         IMPORT_CFM_FUNCTION    OCEPackedRLISize
  959.     ENDIF
  960.  
  961. ;
  962. ;OCEPackRLI packs the RLI into the storage provided as 'prli'.  prli must be
  963. ;large enough to hold the packed RLI.  A memFull error will be returned if
  964. ;prliLength is too small.
  965. ;
  966. ;
  967. ; pascal OSErr OCEPackRLI(const RLI *theRLI, PackedRLI *prli, unsigned short prliLength)
  968. ;
  969.     IF ¬ GENERATINGCFM THEN
  970.         Macro
  971.         _OCEPackRLI
  972.             move.w    #804,d0
  973.             dc.w     $AA5C
  974.         EndM
  975.     ELSE
  976.         IMPORT_CFM_FUNCTION    OCEPackRLI
  977.     ENDIF
  978.  
  979. ;
  980. ;OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
  981. ;PackedRLI manufactured from the parts of an RLI.  This length
  982. ;includes the length of the length field of PackedRLI, so it
  983. ;is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
  984. ;
  985. ;
  986. ; pascal unsigned short OCEPackedRLIPartsSize(const DirectoryName *dirName, RStringPtr *parts, unsigned short nParts)
  987. ;
  988.     IF ¬ GENERATINGCFM THEN
  989.         Macro
  990.         _OCEPackedRLIPartsSize
  991.             move.w    #809,d0
  992.             dc.w     $AA5C
  993.         EndM
  994.     ELSE
  995.         IMPORT_CFM_FUNCTION    OCEPackedRLIPartsSize
  996.     ENDIF
  997.  
  998. ;
  999. ;OCEPackRLIParts packs the parts of an RLI into the storage provided as 'prli'.
  1000. ;prli must be large enough to hold the packed RLI.  A memFull error will be returned
  1001. ;if prliLength is too small.
  1002. ;
  1003. ;
  1004. ; pascal OSErr OCEPackRLIParts(const DirectoryName *dirName, const DirDiscriminator *discriminator, DNodeNum dNodeNumber, RStringPtr *parts, unsigned short nParts, PackedRLI *prli, unsigned short prliLength)
  1005. ;
  1006.     IF ¬ GENERATINGCFM THEN
  1007.         Macro
  1008.         _OCEPackRLIParts
  1009.             move.w    #805,d0
  1010.             dc.w     $AA5C
  1011.         EndM
  1012.     ELSE
  1013.         IMPORT_CFM_FUNCTION    OCEPackRLIParts
  1014.     ENDIF
  1015.  
  1016. ;
  1017. ;Check the equality of two packed prlis.
  1018. ;
  1019. ;
  1020. ; pascal Boolean OCEEqualPackedRLI(const PackedRLI *prli1, const PackedRLI *prli2)
  1021. ;
  1022.     IF ¬ GENERATINGCFM THEN
  1023.         Macro
  1024.         _OCEEqualPackedRLI
  1025.             move.w    #787,d0
  1026.             dc.w     $AA5C
  1027.         EndM
  1028.     ELSE
  1029.         IMPORT_CFM_FUNCTION    OCEEqualPackedRLI
  1030.     ENDIF
  1031.  
  1032. ;
  1033. ;Check the validity of a packed RLI.  This checks that the catalog name length
  1034. ;is within bounds, and the packed pathname (if specified) is valid.
  1035. ;
  1036. ;
  1037. ; pascal Boolean OCEValidPackedRLI(const PackedRLI *prli)
  1038. ;
  1039.     IF ¬ GENERATINGCFM THEN
  1040.         Macro
  1041.         _OCEValidPackedRLI
  1042.             move.w    #822,d0
  1043.             dc.w     $AA5C
  1044.         EndM
  1045.     ELSE
  1046.         IMPORT_CFM_FUNCTION    OCEValidPackedRLI
  1047.     ENDIF
  1048.  
  1049. ;
  1050. ;If this packed RLI describes a Personal Catalog, this call will return a pointer
  1051. ;to an alias record that can be used to find the actual file.  Otherwise, it returns nil.
  1052. ;
  1053. ;
  1054. ; pascal AliasPtr OCEExtractAlias(const PackedRLI *prli)
  1055. ;
  1056.     IF ¬ GENERATINGCFM THEN
  1057.         Macro
  1058.         _OCEExtractAlias
  1059.             move.w    #792,d0
  1060.             dc.w     $AA5C
  1061.         EndM
  1062.     ELSE
  1063.         IMPORT_CFM_FUNCTION    OCEExtractAlias
  1064.     ENDIF
  1065.  
  1066. ;
  1067. ;This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
  1068. ;the root of all catalogs.  It is used in the CollabPack.
  1069. ;
  1070. ;
  1071. ; pascal const PackedRLI *OCEGetDirectoryRootPackedRLI(void)
  1072. ;
  1073.     IF ¬ GENERATINGCFM THEN
  1074.         Macro
  1075.         _OCEGetDirectoryRootPackedRLI
  1076.             move.w    #838,d0
  1077.             dc.w     $AA5C
  1078.         EndM
  1079.     ELSE
  1080.         IMPORT_CFM_FUNCTION    OCEGetDirectoryRootPackedRLI
  1081.     ENDIF
  1082.  
  1083. ;*** LocalRecordID ***
  1084. LocalRecordID             RECORD    0
  1085. cid                         ds.l   2        ; offset: $0 (0)
  1086. recordName                 ds.l   1        ; offset: $8 (8)
  1087. recordType                 ds.l   1        ; offset: $C (12)
  1088. sizeof                     EQU *            ; size:   $10 (16)
  1089.                         ENDR
  1090.  
  1091. ; typedef struct LocalRecordID  LocalRecordID
  1092. ; typedef LocalRecordID     *LocalRecordIDPtr
  1093. ; Create a LocalRecordID from a name, type, and CreationID 
  1094. ;
  1095. ; pascal void OCENewLocalRecordID(const RString *recordName, const RString *recordType, const CreationID *cid, LocalRecordID *lRID)
  1096. ;
  1097.     IF ¬ GENERATINGCFM THEN
  1098.         Macro
  1099.         _OCENewLocalRecordID
  1100.             move.w    #798,d0
  1101.             dc.w     $AA5C
  1102.         EndM
  1103.     ELSE
  1104.         IMPORT_CFM_FUNCTION    OCENewLocalRecordID
  1105.     ENDIF
  1106.  
  1107. ;
  1108. ;Copy LocalRecordID lRID1 to LocalRecordID lRID2.  lRID2 must already contain
  1109. ;pointers to RString structures large enough to hold copies of the corresponding
  1110. ;fields from lRID1.  A memFull error will be returned if that is not the case.
  1111. ;So if you allocate a brand new empty destination, you must at least set up
  1112. ;its length field.
  1113. ;
  1114. ;
  1115. ; pascal OSErr OCECopyLocalRecordID(const LocalRecordID *lRID1, LocalRecordID *lRID2)
  1116. ;
  1117.     IF ¬ GENERATINGCFM THEN
  1118.         Macro
  1119.         _OCECopyLocalRecordID
  1120.             move.w    #770,d0
  1121.             dc.w     $AA5C
  1122.         EndM
  1123.     ELSE
  1124.         IMPORT_CFM_FUNCTION    OCECopyLocalRecordID
  1125.     ENDIF
  1126.  
  1127. ;
  1128. ;Check the equality of two local RIDs.
  1129. ;
  1130. ;
  1131. ; pascal Boolean OCEEqualLocalRecordID(const LocalRecordID *lRID1, const LocalRecordID *lRID2)
  1132. ;
  1133.     IF ¬ GENERATINGCFM THEN
  1134.         Macro
  1135.         _OCEEqualLocalRecordID
  1136.             move.w    #783,d0
  1137.             dc.w     $AA5C
  1138.         EndM
  1139.     ELSE
  1140.         IMPORT_CFM_FUNCTION    OCEEqualLocalRecordID
  1141.     ENDIF
  1142.  
  1143. ;*** ShortRecordID ***
  1144. ShortRecordID             RECORD    0
  1145. rli                         ds.l   1        ; offset: $0 (0)
  1146. cid                         ds.l   2        ; offset: $4 (4)
  1147. sizeof                     EQU *            ; size:   $C (12)
  1148.                         ENDR
  1149.  
  1150. ; typedef struct ShortRecordID  ShortRecordID
  1151. ; typedef ShortRecordID     *ShortRecordIDPtr
  1152. ; Create a ShortRecordID from an RLI struct and a CreationID 
  1153. ;
  1154. ; pascal void OCENewShortRecordID(const PackedRLI *theRLI, const CreationID *cid, ShortRecordIDPtr sRID)
  1155. ;
  1156.     IF ¬ GENERATINGCFM THEN
  1157.         Macro
  1158.         _OCENewShortRecordID
  1159.             move.w    #801,d0
  1160.             dc.w     $AA5C
  1161.         EndM
  1162.     ELSE
  1163.         IMPORT_CFM_FUNCTION    OCENewShortRecordID
  1164.     ENDIF
  1165.  
  1166. ;
  1167. ;Copy ShortRecordID sRID1 to ShortRecordID sRID2.  sRID2 must already contain
  1168. ;pointers to structures large enough to hold copies of the corresponding
  1169. ;fields from sRID1.  A memFull error will be returned if that is not the case.
  1170. ;So if you allocate a brand new empty destination, you must at least set up
  1171. ;its length fields.
  1172. ;
  1173. ;
  1174. ; pascal OSErr OCECopyShortRecordID(const ShortRecordID *sRID1, ShortRecordID *sRID2)
  1175. ;
  1176.     IF ¬ GENERATINGCFM THEN
  1177.         Macro
  1178.         _OCECopyShortRecordID
  1179.             move.w    #778,d0
  1180.             dc.w     $AA5C
  1181.         EndM
  1182.     ELSE
  1183.         IMPORT_CFM_FUNCTION    OCECopyShortRecordID
  1184.     ENDIF
  1185.  
  1186. ;
  1187. ;Check the equality of two short RIDs.
  1188. ;
  1189. ;
  1190. ; pascal Boolean OCEEqualShortRecordID(const ShortRecordID *sRID1, const ShortRecordID *sRID2)
  1191. ;
  1192.     IF ¬ GENERATINGCFM THEN
  1193.         Macro
  1194.         _OCEEqualShortRecordID
  1195.             move.w    #791,d0
  1196.             dc.w     $AA5C
  1197.         EndM
  1198.     ELSE
  1199.         IMPORT_CFM_FUNCTION    OCEEqualShortRecordID
  1200.     ENDIF
  1201.  
  1202. ;*** RecordID ***
  1203. RecordID                 RECORD    0
  1204. rli                         ds.l   1        ; offset: $0 (0)        ; pointer to a packed rli structure 
  1205. local                     ds.l   4        ; offset: $4 (4)
  1206. sizeof                     EQU *            ; size:   $14 (20)
  1207.                         ENDR
  1208.  
  1209. ; typedef struct RecordID     RecordID
  1210. ; typedef RecordID             *RecordIDPtr
  1211. ;    Create a RecordID from a packed RLI struct and a LocalRecordID.
  1212. ;This doesn't allocate any new space; the RecordID points to the same
  1213. ;packed RLI struct and the same name and type RStrings. 
  1214. ;
  1215. ; pascal void OCENewRecordID(const PackedRLI *theRLI, const LocalRecordID *lRID, RecordID *rid)
  1216. ;
  1217.     IF ¬ GENERATINGCFM THEN
  1218.         Macro
  1219.         _OCENewRecordID
  1220.             move.w    #800,d0
  1221.             dc.w     $AA5C
  1222.         EndM
  1223.     ELSE
  1224.         IMPORT_CFM_FUNCTION    OCENewRecordID
  1225.     ENDIF
  1226.  
  1227. ;
  1228. ;Copy RecordID RID1 to RecordID RID2.  RID2 must already contain
  1229. ;pointers to structures large enough to hold copies of the corresponding
  1230. ;fields from lRID1.  A memFull error will be returned if that is not the case.
  1231. ;So if you allocate a brand new empty destination, you must at least set up
  1232. ;its length fields.
  1233. ;
  1234. ;
  1235. ; pascal OSErr OCECopyRecordID(const RecordID *rid1, const RecordID *rid2)
  1236. ;
  1237.     IF ¬ GENERATINGCFM THEN
  1238.         Macro
  1239.         _OCECopyRecordID
  1240.             move.w    #777,d0
  1241.             dc.w     $AA5C
  1242.         EndM
  1243.     ELSE
  1244.         IMPORT_CFM_FUNCTION    OCECopyRecordID
  1245.     ENDIF
  1246.  
  1247. ;    Check the equality of two RIDs. 
  1248. ;
  1249. ; pascal Boolean OCEEqualRecordID(const RecordID *rid1, const RecordID *rid2)
  1250. ;
  1251.     IF ¬ GENERATINGCFM THEN
  1252.         Macro
  1253.         _OCEEqualRecordID
  1254.             move.w    #788,d0
  1255.             dc.w     $AA5C
  1256.         EndM
  1257.     ELSE
  1258.         IMPORT_CFM_FUNCTION    OCEEqualRecordID
  1259.     ENDIF
  1260.  
  1261. ;*** PackedRecordID ***
  1262. ;
  1263. ;struct PackedRecordID is a maximum-sized structure.  Allocate one of
  1264. ;these and it will hold any valid packed RecordID.
  1265. ;
  1266.  
  1267. kPackedRecordIDMaxBytes            EQU        1824
  1268.  
  1269. PackedRecordID             RECORD    0
  1270. dataLength                 ds.w   1        ; offset: $0 (0)
  1271. data                     ds.b   1824    ; offset: $2 (2)
  1272. sizeof                     EQU *            ; size:   $722 (1826)
  1273.                         ENDR
  1274.  
  1275. ; typedef struct PackedRecordID  PackedRecordID
  1276. ;
  1277. ;struct ProtoPackedRecordID is a minimum-sized structure.  Use this
  1278. ;for a variable-length packed RecordID.
  1279. ;
  1280. ProtoPackedRecordID     RECORD    0
  1281. dataLength                 ds.w   1        ; offset: $0 (0)
  1282. sizeof                     EQU *            ; size:   $2 (2)
  1283.                         ENDR
  1284.  
  1285. ; typedef struct ProtoPackedRecordID  ProtoPackedRecordID
  1286. ; typedef PackedRecordID     *PackedRecordIDPtr
  1287. ; typedef ProtoPackedRecordID  *ProtoPackedRecordIDPtr
  1288. ;
  1289. ;Copy PackedRecordID pRID1 to PackedRecordID pRID2.  pRID2 must already contain
  1290. ;pointers to structures large enough to hold copies of the corresponding
  1291. ;fields from pRID1.  A memFull error will be returned if that is not the case.
  1292. ;pRID2Length is the number of bytes that can be put into pRID2, not counting the
  1293. ;packed RecordID header.
  1294. ;
  1295. ;
  1296. ; pascal OSErr OCECopyPackedRecordID(const PackedRecordID *pRID1, const PackedRecordID *pRID2, unsigned short pRID2Length)
  1297. ;
  1298.     IF ¬ GENERATINGCFM THEN
  1299.         Macro
  1300.         _OCECopyPackedRecordID
  1301.             move.w    #774,d0
  1302.             dc.w     $AA5C
  1303.         EndM
  1304.     ELSE
  1305.         IMPORT_CFM_FUNCTION    OCECopyPackedRecordID
  1306.     ENDIF
  1307.  
  1308. ;
  1309. ;Create a RecordID from a PackedRecordID.
  1310. ;NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1311. ;OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL
  1312. ;
  1313. ;
  1314. ; pascal void OCEUnpackRecordID(const PackedRecordID *pRID, RecordID *rid)
  1315. ;
  1316.     IF ¬ GENERATINGCFM THEN
  1317.         Macro
  1318.         _OCEUnpackRecordID
  1319.             move.w    #818,d0
  1320.             dc.w     $AA5C
  1321.         EndM
  1322.     ELSE
  1323.         IMPORT_CFM_FUNCTION    OCEUnpackRecordID
  1324.     ENDIF
  1325.  
  1326. ;
  1327. ;Create a PackedRecordID from a RecordID.  pRID must be large enough to contain
  1328. ;the packed RecordID.  A memFull error will be returned if that is not the case.
  1329. ;packedRecordIDLength is the number of bytes that can be put into pRID, not
  1330. ;counting the header.
  1331. ;
  1332. ;
  1333. ; pascal OSErr OCEPackRecordID(const RecordID *rid, PackedRecordID *pRID, unsigned short packedRecordIDLength)
  1334. ;
  1335.     IF ¬ GENERATINGCFM THEN
  1336.         Macro
  1337.         _OCEPackRecordID
  1338.             move.w    #806,d0
  1339.             dc.w     $AA5C
  1340.         EndM
  1341.     ELSE
  1342.         IMPORT_CFM_FUNCTION    OCEPackRecordID
  1343.     ENDIF
  1344.  
  1345. ;
  1346. ;Compute the number of bytes of memory needed to hold a RecordID when packed. This
  1347. ;length includes the length of the length field of PackedRecordID, so it
  1348. ;is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
  1349. ;
  1350. ;
  1351. ; pascal unsigned short OCEPackedRecordIDSize(const RecordID *rid)
  1352. ;
  1353.     IF ¬ GENERATINGCFM THEN
  1354.         Macro
  1355.         _OCEPackedRecordIDSize
  1356.             move.w    #811,d0
  1357.             dc.w     $AA5C
  1358.         EndM
  1359.     ELSE
  1360.         IMPORT_CFM_FUNCTION    OCEPackedRecordIDSize
  1361.     ENDIF
  1362.  
  1363. ;
  1364. ;Check the equality of two packed RIDs.
  1365. ;
  1366. ;
  1367. ; pascal Boolean OCEEqualPackedRecordID(const PackedRecordID *pRID1, const PackedRecordID *pRID2)
  1368. ;
  1369.     IF ¬ GENERATINGCFM THEN
  1370.         Macro
  1371.         _OCEEqualPackedRecordID
  1372.             move.w    #786,d0
  1373.             dc.w     $AA5C
  1374.         EndM
  1375.     ELSE
  1376.         IMPORT_CFM_FUNCTION    OCEEqualPackedRecordID
  1377.     ENDIF
  1378.  
  1379. ; OCEValidPackedRecordID checks the validity of a packed record ID. 
  1380. ;
  1381. ; pascal Boolean OCEValidPackedRecordID(const PackedRecordID *pRID)
  1382. ;
  1383.     IF ¬ GENERATINGCFM THEN
  1384.         Macro
  1385.         _OCEValidPackedRecordID
  1386.             move.w    #821,d0
  1387.             dc.w     $AA5C
  1388.         EndM
  1389.     ELSE
  1390.         IMPORT_CFM_FUNCTION    OCEValidPackedRecordID
  1391.     ENDIF
  1392.  
  1393. ;*** DSSpec ***
  1394. DSSpec                     RECORD    0
  1395. entitySpecifier             ds.l   1        ; offset: $0 (0)
  1396. extensionType             ds.l   1        ; offset: $4 (4)
  1397. extensionSize             ds.w   1        ; offset: $8 (8)
  1398. extensionValue             ds.l   1        ; offset: $A (10)
  1399. sizeof                     EQU *            ; size:   $E (14)
  1400.                         ENDR
  1401.  
  1402. ; typedef struct DSSpec     DSSpec
  1403. ; typedef DSSpec             *DSSpecPtr
  1404. ;
  1405. ;struct PackedDSSpec is NOT a maximum-sized structure.  Allocate one of
  1406. ;these and it will hold any valid packed RecordID, but not necessarily any additional
  1407. ;data.
  1408. ;
  1409.  
  1410. kPackedDSSpecMaxBytes            EQU        1832
  1411.  
  1412. PackedDSSpec             RECORD    0
  1413. dataLength                 ds.w   1        ; offset: $0 (0)
  1414. data                     ds.b   1832    ; offset: $2 (2)
  1415. sizeof                     EQU *            ; size:   $72A (1834)
  1416.                         ENDR
  1417.  
  1418. ; typedef struct PackedDSSpec  PackedDSSpec
  1419. ;
  1420. ;struct ProtoPackedDSSpec is a minimum-sized structure.  Use this
  1421. ;for a variable-length packed DSSpec.
  1422. ;
  1423. ProtoPackedDSSpec         RECORD    0
  1424. dataLength                 ds.w   1        ; offset: $0 (0)
  1425. sizeof                     EQU *            ; size:   $2 (2)
  1426.                         ENDR
  1427.  
  1428. ; typedef struct ProtoPackedDSSpec  ProtoPackedDSSpec
  1429. ; typedef PackedDSSpec         *PackedDSSpecPtr
  1430. ; typedef ProtoPackedDSSpec  *ProtoPackedDSSpecPtr
  1431. ;
  1432. ;Copy PackedDSSpec pdss1 to PackedDSSpec pdss2.  pdss2 must already contain
  1433. ;pointers to structures large enough to hold copies of the corresponding
  1434. ;fields from pdss1.  A memFull error will be returned if that is not the case.
  1435. ;pdss2Length is the number of bytes that can be put into pdss2, not counting the
  1436. ;packed DSSpec header.
  1437. ;
  1438. ;
  1439. ; pascal OSErr OCECopyPackedDSSpec(const PackedDSSpec *pdss1, const PackedDSSpec *pdss2, unsigned short pdss2Length)
  1440. ;
  1441.     IF ¬ GENERATINGCFM THEN
  1442.         Macro
  1443.         _OCECopyPackedDSSpec
  1444.             move.w    #771,d0
  1445.             dc.w     $AA5C
  1446.         EndM
  1447.     ELSE
  1448.         IMPORT_CFM_FUNCTION    OCECopyPackedDSSpec
  1449.     ENDIF
  1450.  
  1451. ;
  1452. ;Create a DSSpec from a PackedDSSpec.
  1453. ;NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1454. ;OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL.
  1455. ;A pointer to the extension is returned in dss->extensionValue, and the length of that
  1456. ;extension is returned in dss->extensionSize.  If there is no extension, dss->extensionValue will
  1457. ;be set to nil.  This routine will unpack the RecordID (if any) into rid, unpack the rest
  1458. ;into dss, and set dss->entitySpecifier to rid.
  1459. ;
  1460. ;
  1461. ; pascal void OCEUnpackDSSpec(const PackedDSSpec *pdss, DSSpec *dss, RecordID *rid)
  1462. ;
  1463.     IF ¬ GENERATINGCFM THEN
  1464.         Macro
  1465.         _OCEUnpackDSSpec
  1466.             move.w    #815,d0
  1467.             dc.w     $AA5C
  1468.         EndM
  1469.     ELSE
  1470.         IMPORT_CFM_FUNCTION    OCEUnpackDSSpec
  1471.     ENDIF
  1472.  
  1473. ;
  1474. ;Create a PackedDSSpec from a DSSpec.  pdss must be large enough to
  1475. ;contain the packed RecordID and any extension.  A memFull error will be returned if that
  1476. ;is not the case.  pdssLength is the number of bytes that can be put into pdss,
  1477. ;not counting the header.
  1478. ;
  1479. ;
  1480. ; pascal OSErr OCEPackDSSpec(const DSSpec *dss, PackedDSSpec *pdss, unsigned short pdssLength)
  1481. ;
  1482.     IF ¬ GENERATINGCFM THEN
  1483.         Macro
  1484.         _OCEPackDSSpec
  1485.             move.w    #802,d0
  1486.             dc.w     $AA5C
  1487.         EndM
  1488.     ELSE
  1489.         IMPORT_CFM_FUNCTION    OCEPackDSSpec
  1490.     ENDIF
  1491.  
  1492. ;
  1493. ;Compute the number of bytes of memory needed to hold a DSSpec when packed. This
  1494. ;length includes the length of the length field of PackedDSSpec, so it
  1495. ;is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
  1496. ;
  1497. ;
  1498. ; pascal unsigned short OCEPackedDSSpecSize(const DSSpec *dss)
  1499. ;
  1500.     IF ¬ GENERATINGCFM THEN
  1501.         Macro
  1502.         _OCEPackedDSSpecSize
  1503.             move.w    #807,d0
  1504.             dc.w     $AA5C
  1505.         EndM
  1506.     ELSE
  1507.         IMPORT_CFM_FUNCTION    OCEPackedDSSpecSize
  1508.     ENDIF
  1509.  
  1510. ;    Check the equality of two DSSpecs.  This compares all fields, even the
  1511. ;extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1512. ;diacrit-insensitive manner. 
  1513. ;
  1514. ; pascal Boolean OCEEqualDSSpec(const DSSpec *pdss1, const DSSpec *pdss2)
  1515. ;
  1516.     IF ¬ GENERATINGCFM THEN
  1517.         Macro
  1518.         _OCEEqualDSSpec
  1519.             move.w    #782,d0
  1520.             dc.w     $AA5C
  1521.         EndM
  1522.     ELSE
  1523.         IMPORT_CFM_FUNCTION    OCEEqualDSSpec
  1524.     ENDIF
  1525.  
  1526. ;    Check the equality of two PackedDSSpecs.  This compares all fields, even the
  1527. ;extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1528. ;diacrit-insensitive manner. 
  1529. ;
  1530. ; pascal Boolean OCEEqualPackedDSSpec(const PackedDSSpec *pdss1, const PackedDSSpec *pdss2)
  1531. ;
  1532.     IF ¬ GENERATINGCFM THEN
  1533.         Macro
  1534.         _OCEEqualPackedDSSpec
  1535.             move.w    #784,d0
  1536.             dc.w     $AA5C
  1537.         EndM
  1538.     ELSE
  1539.         IMPORT_CFM_FUNCTION    OCEEqualPackedDSSpec
  1540.     ENDIF
  1541.  
  1542. ;
  1543. ;Check the validity of a PackedDSSpec.  If extensionType is
  1544. ;'entn', pdss must contain a valid entitySpecifier.  For all other extensionTypes, a nil
  1545. ;entitySpecifier is valid, but if non-nil, it will be checked for validity.  No check
  1546. ;is made on the extension.
  1547. ;
  1548. ;
  1549. ; pascal Boolean OCEValidPackedDSSpec(const PackedDSSpec *pdss)
  1550. ;
  1551.     IF ¬ GENERATINGCFM THEN
  1552.         Macro
  1553.         _OCEValidPackedDSSpec
  1554.             move.w    #819,d0
  1555.             dc.w     $AA5C
  1556.         EndM
  1557.     ELSE
  1558.         IMPORT_CFM_FUNCTION    OCEValidPackedDSSpec
  1559.     ENDIF
  1560.  
  1561. ;
  1562. ;Return info about a DSSpec.  This routine does not check validity.  If the
  1563. ;DSSpec has no extension, we determine whether it represents the root of all
  1564. ;catalogs, a single catalog, a DNode, or a Record.  Else it is invalid.
  1565. ;If the DSSpec has an extension, we simply return the extension type.
  1566. ;
  1567. ;
  1568. ; pascal OSType OCEGetDSSpecInfo(const DSSpec *spec)
  1569. ;
  1570.     IF ¬ GENERATINGCFM THEN
  1571.         Macro
  1572.         _OCEGetDSSpecInfo
  1573.             move.w    #793,d0
  1574.             dc.w     $AA5C
  1575.         EndM
  1576.     ELSE
  1577.         IMPORT_CFM_FUNCTION    OCEGetDSSpecInfo
  1578.     ENDIF
  1579.  
  1580. ; OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. 
  1581. ;
  1582. ; pascal OSType OCEGetExtensionType(const PackedDSSpec *pdss)
  1583. ;
  1584.     IF ¬ GENERATINGCFM THEN
  1585.         Macro
  1586.         _OCEGetExtensionType
  1587.             move.w    #796,d0
  1588.             dc.w     $AA5C
  1589.         EndM
  1590.     ELSE
  1591.         IMPORT_CFM_FUNCTION    OCEGetExtensionType
  1592.     ENDIF
  1593.  
  1594. ;
  1595. ;OCEStreamPackedDSSpec streams (flattens) a catalog object a little at a time by
  1596. ;calling the DSSpecStreamer routine that you provide.
  1597. ;
  1598. ; typedef DSSpecStreamerUPP  DSSpecStreamer
  1599. ;
  1600. ; pascal OSErr OCEStreamPackedDSSpec(const DSSpec *dss, DSSpecStreamer stream, long userData, unsigned long *actualCount)
  1601. ;
  1602.     IF ¬ GENERATINGCFM THEN
  1603.         Macro
  1604.         _OCEStreamPackedDSSpec
  1605.             move.w    #829,d0
  1606.             dc.w     $AA5C
  1607.         EndM
  1608.     ELSE
  1609.         IMPORT_CFM_FUNCTION    OCEStreamPackedDSSpec
  1610.     ENDIF
  1611.  
  1612. ;*** AttributeType ***
  1613. ;
  1614. ;For the record, an AttributeType is an RString with a smaller maximum size.
  1615. ;I don't just typedef it to an RString, because I want the definition of the AttributeType
  1616. ;struct to contain the max length, because I need to include it in the Attribute struct
  1617. ;below.  But it should be possible to typecast any AttributeType to an RString and use
  1618. ;all the RString utilities on it.
  1619. ;
  1620. AttributeType             RECORD    0
  1621. charSet                     ds.w   1        ; offset: $0 (0)
  1622. dataLength                 ds.w   1        ; offset: $2 (2)
  1623. body                     ds.b   32        ; offset: $4 (4)        ; always fixed at the max size 
  1624. sizeof                     EQU *            ; size:   $24 (36)
  1625.                         ENDR
  1626.  
  1627. ; typedef struct AttributeType  AttributeType
  1628. ; typedef AttributeType     *AttributeTypePtr
  1629. ; Miscellaneous defines:  (these cannot be made into enums) 
  1630.  
  1631. kMinPackedRStringLength            EQU        4
  1632.  
  1633. kMinPackedRLISize                EQU        20
  1634.  
  1635. ;*** AttributeValue ***
  1636. ; same class as is used in AppleEvents 
  1637. ; typedef DescType             AttributeTag
  1638. AttributeValue             RECORD    0
  1639. tag                         ds.l   1        ; offset: $0 (0)
  1640. dataLength                 ds.l   1        ; offset: $4 (4)
  1641. bytes                     ds.l   1        ; offset: $8 (8)
  1642. sizeof                     EQU *            ; size:   $C (12)
  1643.                         ENDR
  1644.  
  1645. ; typedef struct AttributeValue  AttributeValue
  1646. ; typedef AttributeValue     *AttributeValuePtr
  1647. ;*** Attribute ***
  1648. Attribute                 RECORD    0
  1649. attributeType             ds.l   9        ; offset: $0 (0)
  1650. cid                         ds.l   2        ; offset: $24 (36)
  1651. value                     ds.l   3        ; offset: $2C (44)
  1652. sizeof                     EQU *            ; size:   $38 (56)
  1653.                         ENDR
  1654.  
  1655. ; typedef struct Attribute     Attribute
  1656. ; typedef Attribute         *AttributePtr
  1657. ;
  1658. ; pascal RString *OCEGetIndRecordType(OCERecordTypeIndex stringIndex)
  1659. ;
  1660.     IF ¬ GENERATINGCFM THEN
  1661.         Macro
  1662.         _OCEGetIndRecordType
  1663.             move.w    #795,d0
  1664.             dc.w     $AA5C
  1665.         EndM
  1666.     ELSE
  1667.         IMPORT_CFM_FUNCTION    OCEGetIndRecordType
  1668.     ENDIF
  1669.  
  1670. ;
  1671. ; pascal AttributeType *OCEGetIndAttributeType(OCEAttributeTypeIndex stringIndex)
  1672. ;
  1673.     IF ¬ GENERATINGCFM THEN
  1674.         Macro
  1675.         _OCEGetIndAttributeType
  1676.             move.w    #794,d0
  1677.             dc.w     $AA5C
  1678.         EndM
  1679.     ELSE
  1680.         IMPORT_CFM_FUNCTION    OCEGetIndAttributeType
  1681.     ENDIF
  1682.  
  1683.  
  1684. _oceTBDispatch                    EQU        $AA5E
  1685.  
  1686. ;***************************************************************************************
  1687. ;   PLEASE NOTE! ROUTINES HAVE MOVED TO THIS HEADER!
  1688. ;   OCESizePackedRecipient, OCEPackRecipient, OCEUnpackRecipient, OCEStreamRecipient,
  1689. ;   OCEGetRecipientType, and OCESetRecipientType have moved to the OCE header file.
  1690. ;   The OCEMessaging header includes the OCE header, so no changes to your code are
  1691. ;   required.
  1692. ;
  1693. ;***************************************************************************************
  1694. ; typedef DSSpec             OCERecipient
  1695.  
  1696. kOCESizePackedRecipient            EQU        830
  1697. kOCEPackRecipient                EQU        831
  1698. kOCEUnpackRecipient                EQU        832
  1699. kOCEStreamRecipient                EQU        833
  1700. kOCEGetRecipientType            EQU        834
  1701. kOCESetRecipientType            EQU        835
  1702.  
  1703. ;
  1704. ;Compute the space that a OCERecipient would take if it were in packed
  1705. ;form.  [Note: does NOT even pad extensionSize, so you may get an odd #back out]
  1706. ;Safe to pass dereferenced handle(s).
  1707. ;
  1708. ;
  1709. ; pascal unsigned short OCESizePackedRecipient(const OCERecipient *rcpt)
  1710. ;
  1711.     IF ¬ GENERATINGCFM THEN
  1712.         Macro
  1713.         _OCESizePackedRecipient
  1714.             move.w    #830,d0
  1715.             dc.w     $AA5C
  1716.         EndM
  1717.     ELSE
  1718.         IMPORT_CFM_FUNCTION    OCESizePackedRecipient
  1719.     ENDIF
  1720.  
  1721. ;
  1722. ;Take an OCERecipient (scatter) and (gather) stream into the specified
  1723. ;buffer.  It is assumed that there is sufficient space in the buffer (that is
  1724. ;OCESizePackedRecipient).  Safe to pass dereferenced handle(s).
  1725. ;
  1726. ;
  1727. ; pascal unsigned short OCEPackRecipient(const OCERecipient *rcpt, void *buffer)
  1728. ;
  1729.     IF ¬ GENERATINGCFM THEN
  1730.         Macro
  1731.         _OCEPackRecipient
  1732.             move.w    #831,d0
  1733.             dc.w     $AA5C
  1734.         EndM
  1735.     ELSE
  1736.         IMPORT_CFM_FUNCTION    OCEPackRecipient
  1737.     ENDIF
  1738.  
  1739. ;
  1740. ;Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
  1741. ;amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
  1742. ;handle(s).
  1743. ;
  1744. ;
  1745. ; pascal OSErr OCEUnpackRecipient(const void *buffer, OCERecipient *rcpt, RecordID *entitySpecifier)
  1746. ;
  1747.     IF ¬ GENERATINGCFM THEN
  1748.         Macro
  1749.         _OCEUnpackRecipient
  1750.             move.w    #832,d0
  1751.             dc.w     $AA5C
  1752.         EndM
  1753.     ELSE
  1754.         IMPORT_CFM_FUNCTION    OCEUnpackRecipient
  1755.     ENDIF
  1756.  
  1757. ;
  1758. ;Take an OCERecipient (scatter) and (gather) stream using the specified
  1759. ;function.  Safe to pass dereferenced handle(s).  If streamer function returns
  1760. ;OCEError OCEStreamRecipient stops execution and passes the error back to the caller
  1761. ;
  1762. ; typedef OCERecipientStreamerUPP  OCERecipientStreamer
  1763. ;
  1764. ; pascal OSErr OCEStreamRecipient(const OCERecipient *rcpt, OCERecipientStreamer stream, long userData, unsigned long *actualCount)
  1765. ;
  1766.     IF ¬ GENERATINGCFM THEN
  1767.         Macro
  1768.         _OCEStreamRecipient
  1769.             move.w    #833,d0
  1770.             dc.w     $AA5C
  1771.         EndM
  1772.     ELSE
  1773.         IMPORT_CFM_FUNCTION    OCEStreamRecipient
  1774.     ENDIF
  1775.  
  1776. ; Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).
  1777. ;
  1778. ; pascal OSType OCEGetRecipientType(const CreationID *cid)
  1779. ;
  1780.     IF ¬ GENERATINGCFM THEN
  1781.         Macro
  1782.         _OCEGetRecipientType
  1783.             move.w    #834,d0
  1784.             dc.w     $AA5C
  1785.         EndM
  1786.     ELSE
  1787.         IMPORT_CFM_FUNCTION    OCEGetRecipientType
  1788.     ENDIF
  1789.  
  1790. ;
  1791. ;Set the OCERecipient's extensionType in the specified cid.  (Note: we do NOT
  1792. ;check for a nil pointer).  If the extensionType is 'entn', the cid is assumed
  1793. ;to be "valid" and is not touched.  Note: to properly handle non 'entn''s this
  1794. ;routine must and will zero the high long (source) of the cid! Safe to pass
  1795. ;dereferenced handle(s).
  1796. ;
  1797. ;
  1798. ; pascal void OCESetRecipientType(OSType extensionType, CreationID *cid)
  1799. ;
  1800.     IF ¬ GENERATINGCFM THEN
  1801.         Macro
  1802.         _OCESetRecipientType
  1803.             move.w    #835,d0
  1804.             dc.w     $AA5C
  1805.         EndM
  1806.     ELSE
  1807.         IMPORT_CFM_FUNCTION    OCESetRecipientType
  1808.     ENDIF
  1809.  
  1810. ;***************************************************************************************
  1811. ;   PLEASE NOTE! ROUTINES HAVE MOVED TO THIS HEADER!
  1812. ;   OCEGetAccessControlDSSpec and its corresponding data type and constants have
  1813. ;   moved to the OCE header from OCEAuthDir. The OCEAuthDir header includes the OCE
  1814. ;   header, so no changes to your code are required.
  1815. ;   
  1816. ;***************************************************************************************
  1817. ; access categories bit numbers 
  1818.  
  1819. kThisRecordOwnerBit                EQU        0
  1820. kFriendsBit                        EQU        1
  1821. kAuthenticatedInDNodeBit        EQU        2
  1822. kAuthenticatedInDirectoryBit    EQU        3
  1823. kGuestBit                        EQU        4
  1824. kMeBit                            EQU        5
  1825.  
  1826. ; Values of CategoryMask 
  1827. kThisRecordOwnerMask            EQU        1
  1828. kFriendsMask                    EQU        2
  1829. kAuthenticatedInDNodeMask        EQU        4
  1830. kAuthenticatedInDirectoryMask    EQU        8
  1831. kGuestMask                        EQU        16
  1832. kMeMask                            EQU        32
  1833.  
  1834. ; typedef unsigned long     CategoryMask
  1835. ;
  1836. ;pass kThisRecordOwnerMask, kFriendsMask, kAuthenticatedInDNodeMask, kAuthenticatedInDirectoryMask,
  1837. ;kGuestMask, or kMeMask to this routine, and it will return a pointer to a
  1838. ;DSSpec that can be used in the Get or Set Access Controls calls.
  1839. ;
  1840. ;
  1841. ; pascal DSSpecPtr OCEGetAccessControlDSSpec(CategoryMask categoryBitMask)
  1842. ;
  1843.     IF ¬ GENERATINGCFM THEN
  1844.         Macro
  1845.         _OCEGetAccessControlDSSpec
  1846.             move.w    #837,d0
  1847.             dc.w     $AA5C
  1848.         EndM
  1849.     ELSE
  1850.         IMPORT_CFM_FUNCTION    OCEGetAccessControlDSSpec
  1851.     ENDIF
  1852.  
  1853.     ENDIF ; __OCE__
  1854.